/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pagoda.engine.actions;

import org.w3c.dom.Node;
import pagoda.engine.BaseTestEngineParser;
import pagoda.engine.ParseMethod;
import pagoda.engine.TestAction;
import pagoda.engine.TestEngineParseContext;
import pagoda.util.xml.XmlUtil;

/**
 *
 * @author Kevin Krohe
 */
public class PagodaParser extends BaseTestEngineParser {


    @ParseMethod(name="sequence")
    public TestAction OnSequence(Node xmlnode, TestEngineParseContext ctx)
    {
        SequenceAction s = new SequenceAction();
        parseChildren(xmlnode, s);
        return s;
    }

    @ParseMethod(name="var")
    public TestAction OnVar(Node xmlnode, TestEngineParseContext ctx)
    {
        VarAction v = new VarAction();
        String expr = XmlUtil.getAttrValue(xmlnode, "expr");
        v.Value = v.buildExpression(expr);
        return v;
    }

}
